/*
 * @Author       : 梁嘉琳
 * @Date         : 2022-05-27 11:41:04
 * @LastEditors  : 梁嘉琳
 * @LastEditTime : 2022-05-27 14:47:16
 * @FilePath     : \aaa\public\resizeHandle.js
 */
export function resizeRendererToDisplaySize(renderer) {
	const canvas = renderer.domElement;
	const pixelRatio = window.devicePixelRatio;
	const width = (canvas.clientWidth * pixelRatio) | 0;
	const height = (canvas.clientHeight * pixelRatio) | 0;
	const needResize = canvas.width !== width || canvas.height !== height;
	if (needResize) renderer.setSize(width * 2, height * 2, false);
	// if (needResize) renderer.setSize(width, height, false);
	return needResize;
}
